Repository navigation
git-mirror: fstrim the mirror sticky disk before unmount at commit - #63
Open
magma-beef wants to merge 7 commits into
Open
magma-beef wants to merge 7 commits into
magma-beef wants to merge 7 commits into
Conversation
Deleted packs keep their RBD extents allocated on the backing store until the guest discards them. Run a best-effort fstrim on the mirror mount after sync and before unmount, only when the run will commit and only when the host enabled it: the VM agent returns GetStickyDiskResponse.fstrim_timeout_secs (fa live config guest_fstrim_timeout_secs), saved in action state at mount time; 0 means no trim. Any failure or timeout only logs. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…oto package predates it The bundled GetStickyDiskResponse has no fstrim_timeout_secs yet, and protobuf-es keeps fields it does not know in the message's unknown-field list (the gRPC transport is binary), so decode field 8 from there when the typed field is absent. Releases built before the field existed therefore honour the host budget once the agent sends it. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Bump @buf/blacksmith_vm-agent.bufbuild_es to a build that includes GetStickyDiskResponse.fstrim_timeout_secs (fa #6600) and drop the unknown-field-8 decoding. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ackages Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
GetStickyDiskResponse.fstrim_min_extent_bytes (fa #6823) is saved as action state next to the timeout budget and, when positive, becomes `fstrim -m <bytes>` so free extents below the host's threshold are not discarded. Zero or absent leaves fstrim at its default. Bumps the @buf vm-agent packages to the fa main build that carries field 9 and regenerates their licensed records. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


In git-mirror cleanup, run
fstrimon the mirror sticky disk before it is unmounted and committed, so freed blocks are discarded from the backing image.GetStickyDiskResponse.fstrim_timeout_secs(field 8). Mount reads it (from the typed field, or from unknown field 8 when the bundled proto package predates it) and stores it in action state;0/absent disables the trim.shouldCommit), after sync/maintenance and beforeumount.timeout <budget> sudo fstrim -v; any exit code or exception only logs and never fails the step.Start here:
src/blacksmith-cache.ts(fstrimTimeoutSecsFrom, the trim in cleanup);src/state-helper.ts,src/git-source-provider.ts,src/main.tsonly carry the budget from mount to cleanup.dist/is regenerated.Checks:
npm run lint,npx tsc --noEmit -p .,npm test,npm run build.Link to Devin session: https://app.devin.ai/sessions/2e17815c306b4c3cb7af4f6bce008a66
Open in Devin Desktop: https://app.devin.ai/desktop/session/2e17815c306b4c3cb7af4f6bce008a66?variant=devin
Requested by: @magma-beef
Need help on this PR? Tag
@codesmith-botwith what you need.Need help on this PR? Tag
@codesmith-botwith what you need. (Staging)